package com.credithc.customers.api.task;

import com.credithc.customers.base.factory.DictionaryFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * @description: 定时reload字典表 5min
 * @author: denghx
 * @date: 2020/3/15 17:30
 * @param: null
 * @return:
 */
@Component
@Slf4j
public class ScheduleTask {

    @Scheduled(cron = "0 0/5 * * * ?")
    public void reloadDictionary() {
        DictionaryFactory.refreshDicMap();
        DictionaryFactory.getSysMap("unifyCheckRule");
//        Map<String, String> checkRuleDictMap = DictionaryFactory.Dict.UNIFY_CHECK_RULE.getDictMap();
//        String checkRule = checkRuleDictMap.get("YZT");
//        log.error("checkRule"+checkRule);
    }
}
